package com.ytjj.qmyx.users.client;

import com.ytjj.common.api.CommonResult;
import com.ytjj.common.model.ExposureNumResponse;
import com.ytjj.qmyx.users.model.HomeImageResponse;
import com.ytjj.qmyx.users.model.ImServiceUserDto;
import com.ytjj.qmyx.users.model.ReturnGoodsReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;

/**
 *
 *  *
 **/
@FeignClient("ygyx-admin")
public interface AdminClient {

    @GetMapping("/dataStatistics/timing")
    void timing(@RequestParam(value = "localDate") LocalDate localDate);

    @GetMapping("/order/refundOrdersByRpc")
    String refundOrdersByRpc(@RequestParam("orderId") Integer orderId,
                             @RequestParam("desc") String desc);

    @GetMapping("/order/sumExposureByDynamicId")
    ExposureNumResponse sumExposureByDynamicId(@RequestParam Integer dynamicId);

    @GetMapping("/returnGoods/syncReturnRegister")
    CommonResult syncReturnRegister();

    @GetMapping("/returnGoods/syncReturnRegisterByMark")
    void syncReturnRegisterByMark();

    @GetMapping("/returnGoods/syncReturnRegisterByRpc")
    void syncReturnRegisterByRpc();

    @PostMapping("/imService/updateUserStatusByRpc")
    void updateUserStatusByRpc(@RequestBody ImServiceUserDto imServiceUserDto);

    @GetMapping("/adsExpose/scheduleTask")
    void scheduleTask();

    @GetMapping("/special/getDynamicCategory")
    CommonResult getDynamicCategory();

    @GetMapping("/homeImage/getHomeImage")
    HomeImageResponse getHomeImage(@RequestParam Integer id);

    @GetMapping("/dynamicTopicController/getSomeTopicPvTop")
    CommonResult getSomeTopicPvTop();

    @GetMapping("/dynamicTopicController/getTopicInfoAndPvById")
    CommonResult getTopicInfoAndPvById(@RequestParam Integer id);

    /**
     * 自动保存售后责任
     * @param serviceNo
     */
    @GetMapping("/returnGoods/saveReturnDuty")
    void saveReturnDuty(@RequestParam String serviceNo);

    /**
     * 同步到原路返回页
     */
    @GetMapping("/returnGoods/syncReturnRegisterById")
    void syncReturnRegisterById(@RequestParam Integer returnGoodsId);

    /**
     * 获取admin的redis的值
     * @param key
     */
    @GetMapping("/redisInfoController/getRedisString")
    CommonResult<String> getRedisString(@RequestParam String key);

    /**
     * 设置admin的redis的值
     * @param key
     * @param value
     * @return
     */
    @GetMapping("/redisInfoController/updateRedisString")
    CommonResult updateRedisString(@RequestParam("key") String key,@RequestParam("value")String value,@RequestParam("expire")long expire);

    /**
     * 退款
     * @param id
     * @param refundDesc
     * @return
     */
    @GetMapping("/returnRegister/refundOperaRpc")
    String refundOperaRpc(@RequestParam("id") Integer id, @RequestParam("refundDesc")String refundDesc);


}
